import React, { Component } from 'react';

import { Container } from './StyleNoticeCommon'

import Header from '@c/navBar/NavHead'
// import img11 from '@a/images/notice/11_03.png'

class NoticeCommon extends Component {
    state = {
        title: "关于国庆假期的通知",
        list: "晋国学校领导商讨决定，本校于9月30日开始放假，10月8日真个是上课，请各位教师、同学做好放假准备",
        index: 1,
    }

    hanldeClick = () => {
        return () => {
            this.props.history.push('/forwardNotice')
            this.setState({
                index: this.state.index = 0
            })
        }
    }
    hanldeClick2 = () => {
       return() => {
           alert('发送成功，返回')
           this.props.history.goBack()
       } 
    }
    render() {
        let { state } = this.props.location
        return (
            < Container>
                <Header title="通知详情"></Header>
                <div className="detail">
                    <p>{state.tzBody}</p>
                    <p>{state.tzName}</p>
                    <ul>
                        <li><i>发件人</i><span>{state.fname}</span></li>
                        <li><i>发送时间</i><span>{state.tzDate}</span></li>
                        <li><i>来源</i><span>07-01群聊</span></li>
                        <li><i>通知来源</i><span><img src={"http://9z4nm9.natappfree.cc/" + state.img} alt=""/> 签收类通知</span></li>
                    </ul>
                </div>
                <footer>
                    <div className="foot" onClick={this.hanldeClick()} style={ this.state.index === 0 ? { opacity: 1, } : { opacity: 0}}>
                        <p >本地</p>
                        <p onClick={this.hanldeClick2()}>发送</p>
                    </div>
                    <ul style={this.state.index === 0 ? { display:'none' } : { display: "block"}}>
                        <li onClick={this.hanldeClick()}>以文字形式发送</li>
                        <li onClick={() => {this.props.history.goBack()}}>取消</li>
                    </ul>
                </footer>
            </ Container>
        );
    }
}

export default NoticeCommon;